package JackSu.aobing;

/**
 * PositionSumTest
 *
 * @author Syzer
 * @Description
 * @Date 2021/7/7 12:27
 */
public class PositionSumTest {

    public static int getSum(int a, int b) {
        return b == 0 ? a : getSum(a ^ b, (a & b) << 1);
    }

    public static int getCut(int a, int b) {
        return getSum(getSum(a, ~b), 1);
    }

    public static void main(String[] args) {
        for(int i = 0;i < 100;i++) {
            for(int j = 0;j < 100;j++) {
                System.out.println(i + "-" + j + "=" + getCut(i, j));
            }
        }
    }
}
